<?php
/*
* Page Model
* 
* @just for test
* 
*/
class Page_model extends Model {
    function Page_model()
    {
        parent::Model();
        $this->load->database();
    }
	function get_allpages()
    {
        $this->db->orderby('id','desc');
        $query = $this->db->get('page');
        return $query->result();
		
		
		//$this->db->orderby("id", "desc");
		//$this->db->limit(3);
		//$this->db->where('id', 6);
		
		//$this->db->from('page');
		//$query = $this->db->get();
		
		//$this->db->where('url !=','www.mysite.com');
		//$this->db->where('id >', '3');
		
		//$this->db->where('url !=','www.mysite.com' );
		//$this->db->orwhere('url !=','www.anothersite.com' );

		//$query = $this->db->get('page');
		
		//foreach ($query->result() as $row)
		//{
			//echo $row->id." ".$row->name."<br>";
		//}
		
		/*
		$this->db->select('url','name','clientid','people.surname AS client');
		$this->db->where('clientid', '3');
		$this->db->limit(5);
		$this->db->from('sites');
		$this->db->join('people', 'sites.clientid = people.id');
		$this->db->orderby("name", "desc");
		$query = $this->db->get();
		*/
    }
	function insert_page($data)
	{
		$this->db->insert('page', $data);
	}

}